package com.feilong.edgeAI.adapter;

import static com.xuexiang.xutil.data.SPUtils.getDefaultSharedPreferences;

import android.content.Context;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.databinding.ViewDataBinding;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.aiibt.common.core.WDRecyclerAdapter;
import com.aiibt.common.util.Constant;
import com.blankj.utilcode.util.ConvertUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.feilong.edgeAI.R;
import com.feilong.edgeAI.databinding.VoiceItemBinding;
import com.feilong.edgeAI.model.AINetVoiceContentRespone;
import com.feilong.edgeAI.model.CommadClassify;
import com.xuexiang.xutil.data.SPUtils;

import java.util.List;

public class AINetVoiceContentAdapter extends WDRecyclerAdapter<AINetVoiceContentRespone> {
    private Context context;

    public AINetVoiceContentAdapter(Context context, List<AINetVoiceContentRespone> datas) {
        this.context = context;
        addAll(datas);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.voice_item;
    }

    @Override
    protected void bindView(ViewDataBinding binding, AINetVoiceContentRespone item, int position) {
        VoiceItemBinding b = (VoiceItemBinding) binding;
        Glide.with(context).load("http://175.178.26.152:8181"+item.image).into(b.voiceDataImg);
    }

    static class ImageHolder extends RecyclerView.ViewHolder {

        public ImageHolder(@NonNull View view) {
            super(view);
        }
    }

    public interface OnItemClickListener<T> {
        void onItemClick(T item);
    }

    private OnItemClickListener onItemClickListener;

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }
}
